package com.github.sbb.sherry.primitives.rules;

import com.github.sbb.sherry.primitives.api.Facts;
import com.github.sbb.sherry.primitives.core.BasicRule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Y1Rule extends BasicRule {

  private static final Logger logger = LoggerFactory.getLogger(BasicRule.class);

  public Y1Rule(String ruleName) {
    super(ruleName);
  }

  @Override
  public boolean evaluate(Facts facts) {
    return facts.asList().get(0).get("name").equals("赵");
  }

  @Override
  public void execute(Facts facts) throws Exception {
    Object name2 = facts.asList().get(0).get("name2");
    logger.info("我被执行了 name2: {}", name2);
  }
}
